<?php

define ('THIS_SCRIPT', 'assistfb/index.php');
require_once('../lib-common.php');

$pageid=assistfb_getPageInfoCookie('pageid');

if  ($pageid==""){
	echo "Please visit from the facebook page!	";
}else{
	if (function_exists('databox_createdatabycode')){
		$rt=databox_createdatabycode($pageid);
		if ($rt['st']==="created"){
			$url=$_CONF['site_url']."/databox/mydata/data.php?mode=edit&id={$rt['id']}";
		}else{
			$url=$_CONF['site_url']."/index.php";
		}
	}else{
		$url=$_CONF['site_url']."/index.php";
	}
}
$display=COM_refresh($url);
echo $display;

?>